Skip to content

Conversation

@pelwell
Copy link
Contributor

@pelwell pelwell commented Dec 19, 2024

Extend the in-kernel PIO support to include data transfers via DMA. Use that to implement a WS2812 LEDs driver.

Change the Kconfig dependencies so that RP1_PIO depends on FIRMWARE_RP1,
rather than selecting it.

Signed-off-by: Phil Elwell <[email protected]>
Having changed a Kconfig "select" to a "depends on", RP1_PIO must be
explicitly enabled.

Signed-off-by: Phil Elwell <[email protected]>
Sort the probe function initialisation into a more logical order.

Signed-off-by: Phil Elwell <[email protected]>
Floating point arithmetic is not supported in the kernel, so use fixed
point instead.

Signed-off-by: Phil Elwell <[email protected]>
No functional change.

Signed-off-by: Phil Elwell <[email protected]>
Add kernel-facing implementations of pio_sm_config_xfer and
pio_xm_xfer_data.

Signed-off-by: Phil Elwell <[email protected]>
ws2812-pio-rp1 is a PIO-based driver for WS2812 LEDS. It creates a
character device in /dev, the default name of which is /dev/leds<n>,
where <n> is the instance number. The number of LEDS should be set
in the DT overlay, as should whether it is RGB or RGBW, and the default
brightness.

Write data to the /dev/* entry in a 4 bytes-per-pixel format in RGBW
order:

  RR GG BB WW RR GG BB WW ...

The white values are ignored unless the rgbw flag is set for the device.

To change the brightness, write a single byte to offset 0, 255 being
full brightness and 0 being off.

Signed-off-by: Phil Elwell <[email protected]>
Add an overlay to enable a WS2812 LED driver on a given GPIO.

Signed-off-by: Phil Elwell <[email protected]>
Enable the WS2812_PIO_RP1 driver in both the defconfig files that
support the Pi 5 family.

Signed-off-by: Phil Elwell <[email protected]>
@pelwell pelwell merged commit 7aa52f3 into raspberrypi:rpi-6.6.y Dec 20, 2024
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Dec 20, 2024
kernel: dtoverlays: Add override for target-path on I2C overlays
See: raspberrypi/linux#6541

kernel: misc: rp1-pio: Support larger data transfers
See: raspberrypi/linux#6543

kernel: dtoverlays: Use continuous clock mode for ov9281
See: raspberrypi/linux#6542

kernel: overlays: goodix: Allow override i2c address
See: raspberrypi/linux#6547

kernel: Add PIO-assisted WS2812 LEDs driver
See: raspberrypi/linux#6551

kernel: overlays: Add and document i2c_csi_dsi0 parameters
See: raspberrypi/linux#6553
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Dec 20, 2024
kernel: dtoverlays: Add override for target-path on I2C overlays
See: raspberrypi/linux#6541

kernel: misc: rp1-pio: Support larger data transfers
See: raspberrypi/linux#6543

kernel: dtoverlays: Use continuous clock mode for ov9281
See: raspberrypi/linux#6542

kernel: overlays: goodix: Allow override i2c address
See: raspberrypi/linux#6547

kernel: Add PIO-assisted WS2812 LEDs driver
See: raspberrypi/linux#6551

kernel: overlays: Add and document i2c_csi_dsi0 parameters
See: raspberrypi/linux#6553
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant